#ifndef _AUI_DOCVIEW_CHILDFRAME_H
#define _AUI_DOCVIEW_CHILDFRAME_H

#include <wx/wx.h>
#include <wx/toolbar.h>
#include <wx/treectrl.h>
#include <wx/aui/tabmdi.h>

class AUIDocViewChildFrame : public wxAuiMDIChildFrame
{
protected:
	wxToolBar * m_ToolBar;
	bool m_HasToolBar;
	virtual wxMenuBar * CreateMenuBar();
	virtual void CreateControls();
public:
	AUIDocViewChildFrame();
	AUIDocViewChildFrame(wxAuiMDIParentFrame * parent, wxWindowID id = wxID_ANY, 
		const wxString & title = wxEmptyString, bool has_toolbar = true);
	virtual bool Create(wxAuiMDIParentFrame * parent, wxWindowID id = wxID_ANY, 
		const wxString & title = wxEmptyString, bool has_toolbar = true);
		
	virtual wxToolBar* CreateToolBar(long style,
                                     wxWindowID winid,
                                     const wxString& WXUNUSED(name));        
    virtual wxToolBar *GetToolBar() const;
	DECLARE_EVENT_TABLE()	
	void OnActivated(wxActivateEvent & event);
	void OnToolButton(wxCommandEvent & event);
	virtual void OnToggleToolbar(wxCommandEvent & event);
	virtual void OnToggleToolbarUpdateUI(wxUpdateUIEvent & event);
};

class AUIManagedChildFrame : public AUIDocViewChildFrame
{
	wxAuiManager m_FrameManager;
	wxTreeCtrl * m_TreeCtrl;
	virtual wxMenuBar * CreateMenuBar();
	virtual void CreateControls();	
public:
	~AUIManagedChildFrame();

	//virtual bool Create(wxAuiMDIParentFrame * parent, wxWindowID id = wxID_ANY, 
	//	const wxString & title = wxEmptyString, bool has_toolbar = true);
	
	bool GetPaneVisibility(wxString pane_name);
	void TogglePaneVisibility(wxString pane_name);
	DECLARE_EVENT_TABLE()
	void OnToggleTreeCtrl(wxCommandEvent & event);
	void OnToggleTreeCtrlUpdateUI(wxUpdateUIEvent & event);
	virtual void OnToggleToolbar(wxCommandEvent & event);
	virtual void OnToggleToolbarUpdateUI(wxUpdateUIEvent & event);
};

#endif
